<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台管理界面-登录</title>
<script type="text/javascript" src="../common/component/jquery/jquery-1.7.1.js"></script>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Rancho&effect=emboss">
<style type="text/css">

	@font-face { 
	    font-family: "yahei"; 
	    src: url( ../fonts/yahei.eot ); /* IE */ 
    } 

	body {
		margin: 0;
		background-color: #CCCCCC;
	}
	
	#loginDiv {
		position: absolute;
		width: 330px;
		height: 200px;
		background-color: #EEEEEE;
		-moz-border-radius: 15px;      /* Gecko browsers */
		-webkit-border-radius: 15px;   /* Webkit browsers */
		border-radius:15px;  		   /* W3C syntax */
		-webkit-box-shadow:0px 0px 15px 5px #000;
		-moz-box-shadow:0px 0px 15px 5px #000;
		box-shadow:0px 0px 15px 5px #000;
		display: -webkit-box;
		-webkit-box-orient: horizontal;
		-webkit-box-pack: center;
		-webkit-box-align: center;
		display: -moz-box;
		-moz-box-orient: horizontal;
		-moz-box-pack: center;
		-moz-box-align: center;
		display: -o-box;
		-o-box-orient: horizontal;
		-o-box-pack: center;
		-o-box-align: center;
		display: -ms-box;
		-ms-box-orient: horizontal;
		-ms-box-pack: center;
		-ms-box-align: center;
		display: box;
		box-orient: horizontal;
		box-pack: center;
		box-align: center;
	}
	
	#loginDiv input {
		width: 310px;
		height: 30px;
		border: 1px solid #DEDEDE;
		margin-top: 10px;
		-moz-border-radius: 5px;      /* Gecko browsers */
		-webkit-border-radius: 5px;   /* Webkit browsers */
		border-radius:5px;  		   /* W3C syntax */
	}
	
	#loginDiv input[type=button] {
		margin-top: 20px;
		font-size: 20px;
		background-color: #FF9900;
		-moz-transition: background-color 0.5s ease-in;
		-webkit-transition: background-color 0.5s ease-in;
		transition: background-color 0.5s ease-in;
		cursor: pointer;
	}
	
	
	#loginDiv input[type=button]:hover {
		background-color: #FF6600;
	}
	
</style>
</head>
<body>

	<div class="main">
		<div id="loginDiv">
			<input type="text" id="account" name="account" placeholder="请输入管理员账号"><br/>
			<input type="password" id="pwd" name="pwd" placeholder="请输入密码"><br/>
			<input type="button" class="font-effect-emboss" value="登　　录" onclick="doLogin();"/>
		</div>
	</div>

</body>
<script type="text/javascript">

	$(document).ready(function(){
		$("#loginDiv").css("left", ($(document).width() - 340) / 2);
		$("#loginDiv").css("top", ($(document).height() - 210) / 2);
	});
	
	$(document).keydown(function(e){
		var key =  e.which;
   		if(key == 13) {
   			doLogin();
   		}
    });
	
	function doLogin() {
		if(!($("#account").val() && $("#pwd").val())) {
			return;
		}
		$.post("${pageContext.request.contextPath}/adminUser", {account:$("#account").val(),pwd:$("#pwd").val()}, function(data){
			if(data == "success")
				window.location = "index.jsp";
			else
				alert("账号或密码错误");
		});
	}

</script>
</html>